﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ISFProject.Models
{
    public class Team
    {
        [Key]
        public int TeamId { get; set; }

        [Required(ErrorMessage = "Please enter the team name")]
        [StringLength(45, MinimumLength = 3, ErrorMessage = "Invalid fieldlength")]
        [Display(Name="Team name*")]
        public String Name { get; set; }

        public String Picture { get; set; }

        public String Logo { get; set; }

        [Required]
        [EnumDataType(typeof(Gender))]
        public Gender Gender { get; set; }

        [Required]
        [Display(Name="Type of sport")]
        [EnumDataType(typeof(SportCategory))]
        public SportCategory TypeOfSport { get; set; }

        [RegularExpression("([1-9][0-9]*)")]//1-inf
        public int Rank { get; set; }

        public int CoachId { get; set; }
        public virtual Coach Coach { get; set; }

        public int SchoolId { get; set; }
        public virtual School School { get; set; }

        public virtual List<Student> Students { get; set; }
    }
}